<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>第22题</title>
    <script>
        // 用户输入
        var a = parseInt(prompt("请输入一个数字"));
        var b = 0;
        var c = "";
        for (var i =2; i <= a; i++) {
            b += (i + 1) / i;
        }
        console.log(c);
        
        alert(c + "=" + b);
    </script>
</head>
<body>
    
</body>
</html>